#ifndef RobotConection_H
#define RobotConection_H


//!Includes


#include "Aria.h"
#include "ArNetworking.h"
#include <stdio.h>
#include <stdlib.h>

//!Defines


//!Global Functions


namespace algorithms
{

/**
 * class RobotConection
 *
 * Autor:David Bevilaqua
 *
 * DESCRIPTION:
 *
 */

class RobotConection
{
public:

	//!Enums



	//!Constructors/Destructors

	/**
	 * Empty Constructor
	 */
	RobotConection ( );

	/**
	 * Empty Destructor
	 */

	~RobotConection ( );

	//!Public Attributes



	//!Public Accessor Methods



	//!Public Methods

	void Execute ( );
	void ConectWithRobot(int argc,char **argv);
	ArClientBase* GetArClient();
	void SetArClient(ArClientBase* client);


protected:

	//!Protected Attributes



	//!Protected Methods


private:

	//!Private Attributes

	ArClientBase *m_pClient;
	ArClientSimpleConnector *m_pClientConnector;
	ArArgumentParser *m_pParser;
	ArKeyHandler keyHandler;
	ArGlobalFunctor1<ArNetPacket *> jpegHandlerCB;
	ArGlobalFunctor escapeCB;


	//!Private Methods
	void initAttributes ( );
	static void jpegHandler(ArNetPacket *packet);
	static void handleOutputNumbers(ArNetPacket *packet);
	static void Escape( );
};

};

#endif
